package 我的Java学习_算法基础.day_02;

public class _014_最大公约数 {
    static int gys(int m,int n){
        if(n==0){
            return m;
        }
        return gys(n,m%n);
    }
    static int f(int m,int n){
        while(n>0){
            int t =m;
            m=n;
            n=t%n;
        }
        return m;
    }


    public static void main(String[] args) {
        int m=7,n=4;
        System.out.println(gys(m,n));
        System.out.println(f(m,n));
    }
}
